package me.zk.practice1.hw;

import java.util.Scanner;

/**
 * @author zhangkai
 * @date 2023/8/3 12:17
 */
public class HJ2 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String s = in.nextLine();
        if (s.length() < 1) {
            return;
        }
        String ch = in.nextLine();
        int count = 0;
        for (char c : s.toCharArray()) {
            if (String.valueOf(c).equalsIgnoreCase(ch)) {
                count++;
            }
        }
        System.out.println(count);
    }
}
